<?php
if ($type==CommonValues::$gTallyInType['key']['Supplier']){ 
    if (isset($compsList)) {
?>
<table id ='added_components' "cellspacing="0" class="sf_admin_list">
<thead>
<tr>
      <th id="sf_admin_list_th_productcode" width="25%">Product Code
              </th>
      <th id="sf_admin_list_th_description" width="35%">Description
              </th>
      <th id="sf_admin_list_th_description" width="10%">Brand
              </th>
      <th id="sf_admin_list_th_description" width="10%">Unit
              </th>
      <th id="sf_admin_list_th_description">Qty Outstanding</th>
      <th id="sf_admin_list_th_description">Qty Received</th>
</tr>
</thead>
<!--show component here-->
<?php
    foreach ($compsList as $key=>$comps) {
        $comp= ComponentPeer::retrieveByPK($comps->getComponentId());?>
        <tr class="sf_admin_row_<?php echo $key%2?>">
            <input type="hidden" name="rowIds[]" id ="rowIds"  class = "ExistComponents" value="<? echo $comp->getId()?>"/>
            <td><?echo $comp->getProductcode()?></td>
            <td><?echo $comp->getDescription()?></td>
            <td><?echo $comp->getBrand()?></td>
            <td><?echo $comp->getComponentunit()?></td>
            <td><input type="hidden" name="qty2s[]" id ="qty2s" size="7"  value="<? echo $comps->getQty4()?>">
            <input type="text" name="qty3s[]" id ="qty3s" size="7" disabled value="<? echo $comps->getQty4()?>"></td>
            <td><input type="text" name="qtys[]" id ="qtys" size="10" ></td>
<?php }?>
</table>
<?

}
}
else if ($type==CommonValues::$gTallyInType['key']['Project']) {
    if (isset($compsList)) {
        ?>
<table id ='added_components' "cellspacing="0" class="sf_admin_list">
<thead>
<tr>
      <th id="sf_admin_list_th_productcode" width="25%">Product Code
              </th>
      <th id="sf_admin_list_th_description" width="35%">Description
              </th>
      <th id="sf_admin_list_th_description" width="10%">Brand
              </th>
      <th id="sf_admin_list_th_description" width="10%">Unit
              </th>
      <th id="sf_admin_list_th_description">Qty</th>
      <th id="sf_admin_list_th_description">Return Unused Qty</th>
</tr>
</thead>
<!--show component here-->
<?php
    foreach ($compsList as $key=>$comps) {
        $comp= ComponentPeer::retrieveByPK($comps->getComponentId());?>
        <tr class="sf_admin_row_<?php echo $key%2?>">
            <input type="hidden" name="rowIds[]" id ="rowIds"  class = "ExistComponents" value="<? echo $comp->getId()?>"/>
            <td><?echo $comp->getProductcode()?></td>
            <td><?echo $comp->getDescription()?></td>
            <td><?echo $comp->getBrand()?></td>
            <td><?echo $comp->getComponentunit()?></td>
            <td>
            <input type="text" name="outstanding1[]" id ="outstanding1" size="7"  disabled value ="<? echo  $comps->getQty1() - $comps->getQty4(); ?>">
            <input type="hidden" name="qty2s[]" id ="qty2s" size="7"  value ="<? echo $comps->getQty1() - $comps->getQty4();?>">
            </td>
            <td><input type="text" name="qtys[]" id ="qtys" size="10" ></td>
<?php }?>
</table>
<? } }?>